package com.sskj.xgja.view;

import android.content.Context;
import android.util.AttributeSet;

import com.ashokvarma.bottomnavigation.BottomNavigationBar;
import com.ashokvarma.bottomnavigation.BottomNavigationItem;
import com.sskj.xgja.R;

public class NavigationBar extends BottomNavigationBar {

    public NavigationBar(Context context) {
        super(context);
        initTab();
    }

    public NavigationBar(Context context, AttributeSet attrs) {
        super(context, attrs);
        initTab();
    }

    public NavigationBar(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initTab();
    }

    private void initTab() {
        addItem(new BottomNavigationItem(R.mipmap.icon_market_pre, "行情").setInactiveIconResource(R.mipmap.icon_market_nor));
        addItem(new BottomNavigationItem(R.mipmap.icon_optional_pre, "自选").setInactiveIconResource(R.mipmap.icon_optional_nor));
        addItem(new BottomNavigationItem(R.mipmap.icon_transaction_pre, "交易").setInactiveIconResource(R.mipmap.icon_transaction_nor));
        addItem(new BottomNavigationItem(R.mipmap.icon_mine_pre, "我的").setInactiveIconResource(R.mipmap.icon_mine_nor));
        setFirstSelectedPosition(0);
        initialise();
    }
}
